package main

import "fmt"

var name string
var age int
var isOk bool

func constDemo() {
	const (
		n1 = iota
		n2
		n3 = 100
		_
		n4 = iota
	)
	fmt.Printf("%d\n%d\n%d\n%d\n", n1, n2, n3, n4)
	fmt.Println()
	const n5 = "haha"
}
func main() {
	name = "lyq"
	age = 27
	isOk = false
	var (
		a string  = "haha"
		b int     = 1
		c bool    = true
		d float32 = 3.14
	)
	// var 不能省略类型定义
	// var (
	// 	e = 3.14
	// 	f
	// 	g
	// )

	fmt.Printf("%s,%d,%v\n", name, age, isOk)
	fmt.Println()
	fmt.Printf("%T", a)
	fmt.Printf("%T", b)
	fmt.Printf("%T", c)
	fmt.Printf("%T", d)
	fmt.Println()
	constDemo()
}
